package com.mashibing.apiboss.controller;

import com.mashibing.apiboss.service.DriverUserService;
import org.mashibing.dto.Car;
import org.mashibing.dto.DriverUser;
import org.mashibing.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:
 * @create: 2024/4/26 16:35
 * @description:
 */
@RestController
public class DriverUserController {

    @Autowired
    private DriverUserService driverUserService;

    /**
     * 新增司机信息
     */
    @PostMapping("/driver-user")
    public ResponseResult addDriverUser(@RequestBody DriverUser driverUser) {
        return driverUserService.addDriverUser(driverUser);
    }

    /**
     * 修改司机信息
     */
    @PutMapping("/driver-user")
    public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser) {
        return driverUserService.updateDriverUser(driverUser);
    }

    /**
     * 新增车辆信息
     */
    @PostMapping("/car")
    public ResponseResult addCar(@RequestBody Car car) {
        return driverUserService.addCar(car);
    }
}
